<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
<meta http-equiv="Cache-Control" content="no-siteapp" />
 <link href="${pageContext.request.contextPath}/adminfile/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/css/style.css"/>       
        <link href="${pageContext.request.contextPath}/adminfile/assets/css/codemirror.css" rel="stylesheet"></link> 
        <link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/assets/css/ace.min.css"/> 
        <link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/font/css/font-awesome.min.css"/> 
		<script src="${pageContext.request.contextPath}/adminfile/js/jquery-1.9.1.min.js"></script>
        <script src="${pageContext.request.contextPath}/adminfile/assets/js/bootstrap.min.js"></script>
		<script src="${pageContext.request.contextPath}/adminfile/assets/js/typeahead-bs2.min.js"></script>           	
		<script src="${pageContext.request.contextPath}/adminfile/assets/js/jquery.dataTables.min.js"></script>
		<script src="${pageContext.request.contextPath}/adminfile/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="${pageContext.request.contextPath}/adminfile/assets/layer/layer.js" type="text/javascript" ></script>          
        <script src="${pageContext.request.contextPath}/adminfile/assets/laydate/laydate.js" type="text/javascript"></script>
<title>库存列表</title>
</head>

<body>
<div class="page-content clearfix">
    <div id="Member_Ratings">
      <div class="d_Confirm_Order_style">
     <!---->
     <div class="border clearfix">
       <span class="l_f">
        <a href="liststock" id="liststock" class="btn btn-warning"><i class="icon-plus"></i>返回</a>
       </span>
       
     </div>
     <!---->
     <div class="table_menu_list">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
<thead>
		 <tr>
				<th width="25px"><label><input type="checkbox" class="ace"/><span class="lbl"></span></label></th>
				<th width="80">库存id</th>
				<th width="100">艺术品id</th>
				<th width="80">艺术品数量</th>
				<th width="120">供应商名称</th>           
			</tr>
		</thead>
            <c:forEach items="${list2}" var="p2" >
              <tr>
              <th width="25px"><label><input type="checkbox" class="ace"/><span class="lbl"></span></label></th>
              <td>${p2.stockId} </td>
              <td>${p2.artId}</td>
              <td>${p2.artSum}</td>
              <td>${p2.supplierName}</td>
		</tr>
         </c:forEach> 
	</table>
   </div>
  </div>
 </div>
</div>
</body>
<script type="text/javascript">	
jQuery(function($) {
				var oTable1 = $('#sample-table').dataTable( {
				"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,3,4]}// 制定列不参与排序
		] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
</script>
</html>